package aspect;

import java.lang.reflect.Method;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;


public class BeanFactoryAspect implements MethodInterceptor{

	public Object invoke(MethodInvocation mi) throws Throwable {
		begin();
		Object obj = mi.proceed();
		end();
		return obj;
	}
	
	public void begin() {
		System.out.println("开启事务");
	}
	public void end() {
		System.out.println("结束事务");
	}

}
